Skip to content

Add new parameter assets_path_ignore for dash.Dash() #3077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 4, 2025
Merged

Conversation

CNFeffery
Copy link
Contributor

Add new parameter assets_path_ignore to dash.Dash(), for the static resource directory, set several folders that need to be ignored during the initial automatic loading of static resources.

closes #3076

@gvwilson gvwilson added feature something new community community contribution P2 considered for next cycle labels Nov 15, 2024
@gvwilson gvwilson added P1 needed for current cycle and removed P2 considered for next cycle labels Mar 20, 2025
@CNFeffery
Copy link
Contributor Author

@T4rk1n Should I resubmit a PR for this feature to adapt to the latest version of Dash? This feature is very useful for those who want to quickly load static resources such as js on demand in a Dash application. For example, when building an online spreadsheet feature based on Univer in Dash, there are requirements for the loading order of relevant js dependencies. By adding the assets_path_ignore parameter, it is convenient to ensure that the js in the relevant static file directory will not be automatically loaded in a disorderly manner in advance during application initialization.

@@ -0,0 +1,3 @@
#normal-test-target {
background-color: rgba(255, 0, 0, 1);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing endline at the end in the new assets files.

@T4rk1n
Copy link
Contributor

T4rk1n commented May 30, 2025

@T4rk1n Should I resubmit a PR for this feature to adapt to the latest version of Dash? This feature is very useful for those who want to quickly load static resources such as js on demand in a Dash application. For example, when building an online spreadsheet feature based on Univer in Dash, there are requirements for the loading order of relevant js dependencies. By adding the assets_path_ignore parameter, it is convenient to ensure that the js in the relevant static file directory will not be automatically loaded in a disorderly manner in advance during application initialization.

Yes, I want to include this in next release 3.1, up to you if you want to resolve the conflicts in this PR or a new one.

@T4rk1n
Copy link
Contributor

T4rk1n commented Jun 3, 2025

Look like the format check failed:

ERROR: "private::lint.black" exited with 1.

I changed the pre-commit hook to only lint staged files and should runs almost instantly for these cases now.

@CNFeffery
Copy link
Contributor Author

Look like the format check failed:

ERROR: "private::lint.black" exited with 1.

I changed the pre-commit hook to only lint staged files and should runs almost instantly for these cases now.

I can't figure out exactly what caused the code format check to fail 😢, I've used ruff to format related .py files.

@T4rk1n
Copy link
Contributor

T4rk1n commented Jun 3, 2025

Look like the format check failed:

ERROR: "private::lint.black" exited with 1.

I changed the pre-commit hook to only lint staged files and should runs almost instantly for these cases now.

I can't figure out exactly what caused the code format check to fail 😢, I've used ruff to format related .py files.

That is because we use black not ruff 😆

@CNFeffery
Copy link
Contributor Author

Look like the format check failed:

ERROR: "private::lint.black" exited with 1.

I changed the pre-commit hook to only lint staged files and should runs almost instantly for these cases now.

I can't figure out exactly what caused the code format check to fail 😢, I've used ruff to format related .py files.

That is because we use black not ruff 😆

Yes, I used to think that ruff was 100% compatible with the black standard 😣. After executing npm run format, the relevant lint tests have passed, but I don't know how to deal with the remaining failed test test-312 😢

@T4rk1n
Copy link
Contributor

T4rk1n commented Jun 4, 2025

Look like the format check failed:

ERROR: "private::lint.black" exited with 1.

I changed the pre-commit hook to only lint staged files and should runs almost instantly for these cases now.

I can't figure out exactly what caused the code format check to fail 😢, I've used ruff to format related .py files.

That is because we use black not ruff 😆

Yes, I used to think that ruff was 100% compatible with the black standard 😣. After executing npm run format, the relevant lint tests have passed, but I don't know how to deal with the remaining failed test test-312 😢

No worry, the test-312 circleci container has been instable since the update to their v2 container. I started moving tests to github actions.

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@T4rk1n T4rk1n merged commit a5ff987 into plotly:dev Jun 4, 2025
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution feature something new P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for ignoring specific folders under the assets directory
3 participants